home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-09-25 | 1.4 KB | 69 lines | [TEXT/MPS ] |
- # syntax join file1 file2 … > combinedFile
- # Combine dismembered binhex files
- # Comments at the start of first part echoed to Worksheet
-
- Set Exit 0 # keep going
- Set CaseSensitive 1
-
- Set part 1
-
- For i in {"Parameters"}
- If "{i}" == '§'
- Mark -y § OldSel "{Target}"
- Find Δ§
- Else
- Target "{i}" # put the file in a window
- Find •
- End
- Loop
- Find Δ/part [0-9]+ of [0-9]+]/!5:Δ/ /
- Break If {status} ≠ 0
- Set cur "`Catenate §`"
- If {cur} ≠ {part}
- Echo "Out of order" > "Dev:StdErr"
- Exit 2
- End
- If {cur} == 1
- # Find out how many parts there areFind
- Find Δ/[0-9]+]/:Δ/]/
- Set last `Catenate §`
- # Copy comments in the first part to std err
- Find !0:Δ/∂(This file must/
- Catenate § > "Dev:StdErr"
- Else
- Find !0
- Echo -n "### " > "Dev:StdErr"
- Catenate § > "Dev:StdErr"
- Find /•---/!1
- End
- # Grab the contents of part n
- Find §Δ:Δ/--- end of part {cur}/
- Catenate §
- Find Δ!1
- Set part `Evaluate {part} + 1`
- End
- If {cur} == {last}
- Find ¡1Δ
- Find §¡1:§¡1
- Set char "`Catenate §`"
- If ("{char}" ≠ ":")
- Echo "Parts incomplete or out of order" > "Dev:StdErr"
- Exit 2
- End
- End
- If "{i}" != '§'
- Find ∞
- Close "{i}"
- Else
- Find 'OldSel'
- Unmark 'OldSel' "{Target}"
- End
- End
-
- If ({cur} ≠ {last})
- Echo "Parts `Evaluate {cur} + 1` to {last} missing" > "Dev:StdErr"
- Exit 2
- Else
- Echo "### Joined {cur} parts of {last}" > "Dev:StdErr"
- End
-